/* 生成随机数示例代码 */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(int argc, char *argv[])
{
    int random_number_buf[8];

    /* 设置随机数种子 */
    srand(time(NULL));

    /* 生成伪随机数 */
    for (int count = 0; count < 8; count++) {
        random_number_buf[count] = rand() % 10;
    }

    /* 打印随机数数组 */
    printf("[");
    for (int count = 0; count < 8; count++) {
        printf("%d", random_number_buf[count]);
        if (count != 8-1) {
            printf(", ");
        }
    }
    printf("]\n");

    exit(0);
}